package com.bsb.biz.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bsb.base.mapper.BsbExpertQuExMapper;
import com.bsb.base.mapper.BsbExpertQuMapper;
import com.bsb.base.mapper.BsbExpertVoiceMapper;
import com.bsb.base.model.BsbExpertQu;
import com.bsb.base.model.BsbExpertQuExample;
import com.bsb.base.model.BsbExpertVoice;
import com.bsb.base.model.BsbFirmExample;
import com.bsb.base.model.BsbUserExample;
import com.bsb.base.model.ExpertQuUserFirm;

@Service
public class BsbExpertQuService{
	
	@Resource
	private BsbExpertQuMapper bsbExpertQuMapper;
	@Resource
	private BsbExpertVoiceMapper bsbExpertVoiceMapper;
	
	@Resource
	private BsbExpertQuExMapper bsbExpertQuExMapper;
	
	public void addBsbExpertQu(BsbExpertQu bsbExpertQu) {
		bsbExpertQuMapper.insertSelective(bsbExpertQu);
	}
	
	public void delBsbExpertQuByUuid(String uuid) {
		bsbExpertQuMapper.deleteByPrimaryKey(uuid);
	}
	
	public void updateBsbExpertQu(BsbExpertQu bsbExpertQu) {
		bsbExpertQuMapper.updateByPrimaryKeySelective(bsbExpertQu);
	}
	
	public void updateBsbExpertQuByExample(BsbExpertQu bsbExpertQu,BsbExpertQuExample bsbExpertQuExample){
	    bsbExpertQuMapper.updateByExampleSelective(bsbExpertQu,bsbExpertQuExample);
	}
	
	public BsbExpertQu getBsbExpertQuByUuid(String uuid) {
		return bsbExpertQuMapper.selectByPrimaryKey(uuid);
	}
	
	public List<BsbExpertQu> getPageBsbExpertQu(BsbExpertQuExample bsbExpertQuExample) {
		return bsbExpertQuMapper.selectPage(bsbExpertQuExample);
	}
	
	public int countBsbExpertQu(BsbExpertQuExample bsbExpertQuExample) {
		return bsbExpertQuMapper.countByExample(bsbExpertQuExample);
	}
	
	public List<BsbExpertQu> selectByExample(BsbExpertQuExample example){
	    return bsbExpertQuMapper.selectByExample(example);
	}

	public void addExpertQuVoice(BsbExpertQu bsbExpertQu, BsbExpertVoice voice) {
		bsbExpertQuMapper.insertSelective(bsbExpertQu);
		bsbExpertVoiceMapper.insertSelective(voice);
	}
	
	public List<ExpertQuUserFirm> getExpertQuUserFirms(BsbExpertQuExample example,BsbUserExample userExample,BsbFirmExample firmExample){
		return bsbExpertQuExMapper.selectExpertQuUserFirm(example, userExample, firmExample);
	}
	
	public int getCountExpertQuUserFirm(BsbExpertQuExample example,BsbUserExample userExample,BsbFirmExample firmExample){
		return bsbExpertQuExMapper.countExpertQuUserFirmByExample(example, userExample, firmExample);
	}
}
